<?php
namespace app\index\controller;

use app\index\logic\Index as indexLogic;
use think\facade\View;

class Index extends Main
{
    public function index()
    {
        $list = (new indexLogic())->index($this->site, $this->lang);
        View::assign('list', $list);
        return View::fetch();
    }

    public function category()
    {
        $list = (new indexLogic())->category($this->site, $this->lang);
        if($list['code'] != 10000){
            View::error($list['msg']);
        }
        View::assign('list', $list['list']);
        return View::fetch($list['tpl']);
    }

    public function detail()
    {
        $article = (new indexLogic())->detail();
        if($article['code']!= 10000){
            View::error($article['msg']);
        }
        View::assign('article', $article['detail']);
        return View::fetch();
    }
}
